Skip to content

chore(bricks): remove dead constructor hook + document sanitizer contract - #120

Merged
jackgranatowski merged 1 commit into
mainfrom
chore/rest-controller-cleanup-and-sanitizer-docs
May 27, 2026
Merged

chore(bricks): remove dead constructor hook + document sanitizer contract#120
jackgranatowski merged 1 commit into
mainfrom
chore/rest-controller-cleanup-and-sanitizer-docs

Conversation

@kiro-agent

@kiro-agent kiro-agent Bot commented May 27, 2026

Copy link
Copy Markdown

This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻

Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent


Follow-up to #116 (merged). Addresses two non-blocking review findings:

Changes

  1. REST controller: remove dead add_action from constructor

    • slashed_bricks_rest_routes_init() already calls register_routes() directly inside rest_api_init
    • The constructor's add_action('rest_api_init', ...) was redundant — it would fire too late (hook already running) or cause double-registration
    • Constructor is now a documented no-op
  2. Token sanitizer: document compound-prefix key contract

    • Dark-mode keys like brand_dark_primary enter the sanitizer's "direct" bucket (they don't end in _hex/_raw)
    • Added docblock explaining this is intentional and warning against color names ending in "hex" or "raw"

No functional changes

Both are documentation/cleanup only — no behavior differs.

…ract

- REST controller: remove add_action('rest_api_init') from constructor
  since routes are now registered directly by the rest_api_init hook in
  slashed-bricks.php. Eliminates redundant double-registration on REST
  requests.

- Token sanitizer: add COMPOUND-PREFIX KEYS docblock to
  sanitize_color_section() documenting that dark-mode keys
  (brand_dark_*) intentionally enter the 'direct' bucket and that
  color names must never end in 'hex' or 'raw'.
@jackgranatowski
jackgranatowski merged commit 7585dd7 into main May 27, 2026
4 checks passed
@jackgranatowski
jackgranatowski deleted the chore/rest-controller-cleanup-and-sanitizer-docs branch May 31, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants